import request from '@/utils/request'

export const GOOGLE_LOGIN_URL =
	// 'http://localhost:5000/user/auth2/login'
	'https://densimetric-hunter-combustive.ngrok-free.app/user/auth2/login'

// 邮箱登录
export const login = (data) => {
	return request<{ access_token: string; refresh_token: string }>(
		'/user/login',
		'post',
		data
	)
}

// 刷新token令牌
export const refresh = () => {
	return request<{ access_token: string }>('/user/refresh')
}

// 获取用户信息
export const getUser = () => {
	return request<any>('/user/info')
}

// 获取模型列表
export const getModels = () => {
	return request<any>('/form/model')
}

// 获取预设列表
export const getPresets = () => {
	return request<any>('/form/preset')
}

// 文件上传
export const uploadFile = (data: FormData) => {
	return request<any>('/form/upload', 'post', data)
}

// 图生视频
export const imageToVideo = (data: any) => {
	return request<any>('/form', 'post', data)
}
